<!DOCTYPE html>
<html lang="zh-cn">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
  <meta name="renderer" content="webkit">
  <title></title>
  <link rel="stylesheet" href="__CSS__/pintuer.css?v={$src_version}">
  <link rel="stylesheet" href="__CSS__/admin.css?v={$src_version}">
  <link rel="stylesheet" href="__CSS__/responsive.css?v={$src_version}">
  <script src="__JS__/jquery-3.2.1.min.js?v={$src_version}"></script>
  <script src="__JS__/pintuer.js?v={$src_version}"></script>
  <script src="__JS__/jquery.nicescroll.js"></script>
  <script src="__PUBLIC__/layer.js?v={$src_version}"></script>
  <script src="__JS__/ming.js?v={$src_version}"></script>
  <script src="__JS__/ifram_scroll.js?v={$src_version}"></script>
  <script src="__JS__/responsive.js?v={$src_version}"></script>
</head>

<body>

  <div class="panel admin-panel ">
    <div class="panel-head" id="add">
      <strong>
        <span class="icon-pencil-square-o"></span>添加/修改</strong>
    </div>
    <div class="body-content">
      <form method="post" class="form-x" id="frm" action="">

        <div class="form-group">
          <div class="label">
            <label>
              <strong style="color:#f00;">*</strong>姓名</label>
          </div>
          <div class="field">
            <input type="text" class="input w50" id="arealname" value="{$edit.arealname}" name="arealname" maxlength="20" />
          </div>
        </div>

        <div class="form-group">
          <div class="label">
            <label>部门名称</label>
          </div>
          <div class="field">
              <if condition="$branch"> 
                <select id="schoolname" name="dname" class="input w50">
                    <foreach name="branch" item="vo" >
                        <option  <if condition="$edit['dname'] eq $vo['id']"> selected</if> value="{$vo.id}" >{$vo.brank_name}</option>
                    </foreach>
                </select>
              </if>
            <!-- <input type="text" class="input w50" id="schoolname" value="{$edit.dname}" name="dname" maxlength="100" /> -->
          </div>
        </div>
        <div style="padding-left: 30%;color:#999;">手机号为登录帐号</div>
        <div class="form-group">
          <div class="label">
            <label>
              <strong style="color:#f00;">*</strong>手机号</label>
          </div>
          <div class="field">
            <input type="text" class="input w50" id="aname" value="{$edit.aname}" name="aname" maxlength="11" />
          </div>
        </div>
        <div style="padding-left: 30%;color:#999;">不填则为原密码</div>
        <div class="form-group">
          <div class="label">
            <label>
              <strong style="color:#f00;">*</strong>密&nbsp;&nbsp;&nbsp;&nbsp;码</label>
          </div>
          <div class="field">
            <input type="password" class="input w50" name="apwd" id="apwd" maxlength="50" />

          </div>
        </div>
        <div class="form-group">
          <div class="label">
            <label></label>
          </div>
          <div class="field">
            <input type="hidden" name="id" id="id" value="{$edit.aid}" />
            <input type="hidden" name="act" value="add" />
            <div class="button-group">
              <a class="button bg-main" href="javascript:;" id="sbt">
                <span class="icon-check-square-o"></span> 提交
              </a>

              <a class="button border-main" href="javascript:history.go(-1)">
                <span class="icon-mail-reply"></span> 返回</a>
            </div>
          </div>
        </div>
      </form>
    </div>
  </div>
  <script type="text/javascript">
    $(function () {
      $('#sbt').click(function () {

        var arealname = $.trim($('#arealname').val());
        var aname = $.trim($('#aname').val());
        var apwd = $.trim($('#apwd').val());
        var id = $.trim($('#id').val());
        if (arealname == '') {
          layer.msg('请填写姓名', { icon: 2 });
          return false;

        }
        if (aname == '') {
          layer.msg('请输入登录帐号', { icon: 2 });
          return false;

        }
        if (!is_mobile(aname)) {
          layer.msg('登录帐号为手机号', { icon: 2 });
          return false;

        }

        if (id == '') {

          if (apwd == '') {
            layer.msg('请输入密码', { icon: 2 });
            return false;

          }
        }



        $.mAjax("{:U('Manager/add')}", $('#frm').serialize(), 'json', 'sbt', '提交中...', '<span class="icon-check-square-o"></span> 提交');

      });



    });



  </script>
</body>

</html>